Hi all, |
Re: callback for closing a db
Hm, I wonder how you assigned a callback to the "Close" button and made it not fire when the user clicks the "X".
void closeDB (DB db)
{
print "Close DB callback"
hide db
destroy db
db = null
}
DB baseDB = create("")
close(baseDB, true, closeDB)
show baseDB
|
Re: callback for closing a db Peter_Albert - Thu Jul 02 06:09:54 EDT 2009
Hm, I wonder how you assigned a callback to the "Close" button and made it not fire when the user clicks the "X".
void closeDB (DB db)
{
print "Close DB callback"
hide db
destroy db
db = null
}
DB baseDB = create("")
close(baseDB, true, closeDB)
show baseDB
If you specify 'false', the close button doesn't appear but the callback fires when you 'X' it. If you do that, you can specify a different 'apply' button with label 'Close', and then you can get two different behaviors, one for 'X' and one for Close.
Of course, be sure to debug your 'close' callback carefully, otherwise you may not be able to close the dialog. Adding "if (confirm("Close Dialog")) hide db" at the top is a reasonable debug for it. |
Re: callback for closing a db The behaviour that you describe, is what I would have expected. But somehow we had some strange effects here that seemed to indicate that for a specific DXL closing via button did fire the callback but closing via 'x' did not. But now I do not seem to be able to reproduce this. Thank you anyway. Karl |